package cn.bonoon.kernel.support.services.handler;

import cn.bonoon.kernel.support.entities.EntityTree;

public class OperateTreeUpHandler<E extends EntityTree<E>> extends AbstractTreeUpAndDownHandler<E>{
	public OperateTreeUpHandler(Class<E> entityClass) {
		super(entityClass, "x.ordinal<:ordinal order by x.ordinal desc", 
				"ordinal>=? and ordinal<?", "ordinal>? and ordinal<?", "ordinal>=?");
	}
	
	@Override
	protected int getOrdinalTargetGreate(int targetOrdinal) {
		return targetOrdinal - 1;
	}
}
